<?PHP

  $files = glob('/home/dmdirc/www/updates/launchers/*.*');
  $versions = array();

  foreach ($files as $file) {
   list($platform, $version) = explode('-', substr(basename($file), 0, strpos(basename($file), '.')));

   if (!isset($versions[$platform][0]) || (int) $version > $versions[$platform][0]) {
    $versions[$platform] = array((int) $version, basename($file));
   }
  }

  foreach ($versions as $platform => $data) {
   list($version, $file) = $data;

   $_VERSIONS['launcher-' . $platform]['ALL'] = array(
	'id' => $version,
	'string' => $version,
	'file' => 'http://updates.dmdirc.com/launchers/' . $file
   );
  }

?>
